<!--
 *@description:
 *@author: Ming
 *@date: 2021-05-29 22:42:17
 *@version: V1.0.5
-->
<template>
  <div class="tabs-pane" v-if="active">
    <slot></slot>
  </div>
</template>

<script>
export default {
  name:'LmTabsPane',
  props: {
    name:{
      type:[String,Number],
      required:true
    }
  },
  data() {
    return {
      active:false
    };
  },
  inject:['eventBus'],
  created() {
    this.eventBus.$on('update:selected',name=>{
      this.active = name===this.name
    })
  },
  methods: {
    selected(){
      this.eventBus.$emit('update:selected',this.name)
    }
  },
};
</script>

<style scoped>

</style>
